package com.fz.test;

import android.graphics.Paint;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.StrikethroughSpan;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.ab.activity.BaseActivity;
import com.fz.View.MeiZiIView;

public class ZhenActivity extends BaseActivity {
	private MeiZiIView v;
	private FrameLayout f;
	private TextView textview1;
	private TextView textview2;
	private TextView textview3;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_zhen);
		textview1=(TextView) findViewById(R.id.textView1);
		textview2=(TextView) findViewById(R.id.textView2);
		textview3=(TextView) findViewById(R.id.textView3);
		//下划线
		textview2.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
		//中划线
		textview1.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
		//中划线
		String s="text";
		SpannableString sp = new SpannableString(s);
		sp.setSpan(new StrikethroughSpan(), 0, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
		textview3.setText(sp);
		v=new MeiZiIView(this);
		f=(FrameLayout) findViewById(R.id.f);
		v.setOnTouchListener(new View.OnTouchListener() {
			
			@Override
			public boolean onTouch(View arg0, MotionEvent arg1) {
				v.bitmapX = arg1.getX();
                v.bitmapY = arg1.getY();
                v.invalidate();
				return true;
			}
		});
		f.addView(v);
	}

}
